<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<script type="text/javascript" src="validate.js"></script>
<link rel="stylesheet" type="text/css" href="../General Info/css.css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>BPiM</title>
</head>

<body>
		<jsp:include page="../General Info/header.jsp"/>
	<div class="body">
		<div class="tab1">
		</div>
		
		<div class="tab2">
			<% if (session.getAttribute("loggedIn") == null && session.getAttribute("postback") == "true") { %>
				<div class="loginError">Invalid Email-address and/or password. Please try again.</div>
			<%  session.setAttribute("loggedIn", null);
				session.setAttribute("postback", null);
				}else{
			%>
				<div class="notLoginError"></div>
			<%} %>	
			
			<fieldset class="registrationForm">
				<legend class="legend">Register your new account</legend>
				<form name="regForm" onsubmit="return validate(this)" method="GET" action="createNewUser.jsp">
					<div class="errorMesageTab" id="errorMesageTab"></div>
					<table>
						<tr>
							<td class="field">First Name:</td>
							<td><input id="firstName" class="inputRegistration" type="text" onblur="validateFirstName();" name="firstName" /></td><td><span class="error" id="erFirstName"></span></td>				
						</tr>
						<tr>
							<td class="field">Last Name:</td>
							<td><input id="lastName" class="inputRegistration" type="text" onblur="validateLastName()" name="lastName" /></td><td><span class="error" id="erLastName"></span></td>
						</tr>
						<tr>
							<td class="field">Phone Number:</td>
							<td><input id="phoneNumber" class="inputRegistration" type="text"	onblur="validatePhoneNumber()" name="phoneNumber" /></td><td><span class="error" id="erPhoneNumber"></span></td>
						</tr>
						<tr>
							<td class="field">City:</td>
							<td><input id="city" class="inputRegistration" type="text" onblur="validateCity()" name="city" /></td><td><span class="error" id="erCity"></span></td>
						</tr>
						<tr>
							<td class="field">Email Address:</td>
							<td><input id="emailAddress" class="inputRegistration" type="text" onblur="validateEmailAddress()" name="emailAddress" /></td><td><span class="error" id="erEmailAddress"></span></td>
						</tr>
						<tr>
							<td class="field">Password:</td>
							<td><input id="password" class="inputRegistration" type="password" onblur="validatePassword()" name="password" /></td><td><span class="error" id="erPassword"></span></td>
						</tr>
						<tr>
							<td class="field">Retype Password:</td>
							<td><input id="retypedPassword" class="inputRegistration" type="password"	onblur="validateRetypedPassword()" name="retypedPassword" /></td><td><span class="error" id="erRetypedPassword"></span></td>
						</tr>
						<tr>
							<td></td>
							<td><input type="submit" class="inputButton" value="Register" /></td>
						</tr>
					</table>
					<% if (session.getAttribute("registration")=="true") { %>
					<div class="successfulRegistration" id="successfulRegistration">New user registration successful. Please log in!!</div>
					<%session.setAttribute("registration", null);
					}
					else{
					%><div class="notSuccessfulRegistration" id="notSuccessfulregistration"></div>
					
					<%} %>
				</form>
			</fieldset>

		</div>
		<div class="push"></div>
		</div>
		<jsp:include page="../General Info/footer.jsp"/>
</body>
</html>